package com.foreveross.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.format.annotation.DateTimeFormat;

import com.foreveross.vo.common.AffiliatedBaseVo;

@Entity
@Table(name = "hr_business", catalog = "hrtenement")
public class HrBusiness extends AffiliatedBaseVo implements java.io.Serializable {

	private String id;
	private String name;
	private String address;
	private String phone;
	private HrHouses houseId;
	private SysUser createId;
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	public HrBusiness() {
	}
	
	public HrBusiness(String id) {
		this.id = id;
	}

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "house_id")
	@NotFound(action=NotFoundAction.IGNORE)
	public HrHouses getHouseId() {
		return houseId;
	}

	public void setHouseId(HrHouses houseId) {
		this.houseId = houseId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "create_id")
	@NotFound(action=NotFoundAction.IGNORE)
	public SysUser getCreateId() {
		return createId;
	}

	public void setCreateId(SysUser createId) {
		this.createId = createId;
	}

	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

}
